I'm testing how changing the external trigger rate affects the data rate for the nalu system. I still don't know how to construct events from the UDP packets, so the true event rate is unknown with these tests. Also keep in mind I'm not bothering to adjust the fine rate tuning knob on the gate generator.
Gate Generator Knob Setting (Hz) | Oscilloscope Measured Rate (Hz) | MIDAS Data Rate (MB/s) | Screenshot Link |
---|---|---|---|
1 | <10 | 0.25 | Link |
10 | 18 | 2.7 | Link |
100 | 191 | 14.1 | Link |
1000 | 1850 | 21 | Link |
10000 | 17855 | 17.6 | Link |
100000 | 172700 | 17.7 | Link |
It seems the highest achievable rate is about 21 MB/s. But it is indeed responding to the external trigger in some way.
I took some data using the NaluScope with varying gate generator (external trigger) rate:
Gate Generator Knob Setting (Hz) | Oscilloscope Measured Rate (Hz) |
---|---|
1 | <10 |
10 | 18 |
100 | 191 |
1000 | 1850 |
10000 | 17855 |
100000 | 172700 |
The goal being to see how external trigger rate affects the rate of events digitized.
Here is the structure of an event read in from an aquisition:
{'window_labels': [[], [], [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], 'evt_window_labels': [[], [], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], 'data': [array([], dtype=float64), array([], dtype=float64), array([2053, 2108, 2102, 2078, 2073, 2092, 2099, 2090, 2058, 2074, 2076, 2095, 2094, 2078, 2028, 2069, 2106, 2088, 2072, 2025, 2009, 2082, 2078, 2067, 2068, 2058, 2028, 2054, 2024, 2075, 2074, 2080, 2056, 2046, 2071, 2076, 2054, 2044, 2078, 2085, 2002, 2032, 2040, 2035, 2033, 2046, 2050, 2025, 2033, 2078, 2071, 2040, 2005, 2026, 2044, 2040, 2003, 2040, 2046, 2032, 2055, 2076, 2054, 2025, 2040, 2069, 2082, 2088, 2048, 2046, 2052, 1984, 1664, 1573, 1573, 1620, 1572, 1558, 1529, 1518, 1534, 1541, 1538, 1480, 1491, 1516, 1520, 1477, 1529, 1519, 1459, 1488, 1486, 1500, 1517, 1516, 1590, 1516, 1566, 1554, 1518, 1517, 1528, 1516, 1455, 1446, 1486, 1466, 1488, 1468, 1467, 1452, 1486, 1467, 1510, 1526, 1463, 1492, 1487, 1451, 1491, 1506, 1468, 1491, 1496, 1516, 1493, 1481, 1487, 1493, 1492, 1490, 1470, 1469, 1484, 1502, 1495, 1488, 1457, 1504, 1520, 1489, 1516, 1492, 1535, 1568, 1509, 1503, 1488, 1536, 1540, 1516, 1490, 1517, 1502, 1515, 1501, 1540, 1544, 1539, 1547, 1522, 1524, 1541, 1566, 1540, 1538, 1542, 1524, 1542, 1536, 1568, 1506, 1518, 1554, 1528, 1548, 1536, 1559, 1550, 1510, 1542, 1505, 1510, 1517, 1526, 1555, 1568, 1556, 1552, 1506, 1536, 1537, 1558, 1576, 1540, 1483, 1497, 1503, 1542, 1525, 1515, 1531, 1528, 1491, 1526, 1540, 1523, 1542, 1568, 1554, 1530, 1522, 1550, 1550, 1527, 1516, 1524, 1498, 1518, 1534, 1525, 1532, 1541, 1570, 1528, 1549, 1561, 1542, 1544, 1559, 1569, 1510, 1527, 1542, 1568, 1557, 1528, 1542, 1556, 1565, 1563, 1584, 1602, 1507, 1566, 1550, 1518, 1550, 1546, 1547, 1567, 1560, 1593, 1564, 1574, 1614, 1618, 1644, 1616, 1607, 1638, 1634, 1598, 1616, 1599, 1616, 1619, 1594, 1605, 1612, 1596, 1628, 1619, 1608, 1640, 1592, 1626, 1645, 1579, 1606, 1643, 1606, 1617, 1592, 1619, 1635, 1619, 1624, 1544, 1658, 1673, 1646, 1669, 1650, 1640, 1593, 1612, 1630, 1637, 1644, 1606, 1628, 1620, 1646, 1629, 1635, 1646, 1641, 1644, 1657, 1598, 1622, 1622, 1620, 1620, 1608, 1640, 1629, 1619, 1614, 1619, 1670, 1632, 1596, 1598, 1626, 1610, 1638, 1604, 1644, 1622, 1625, 1622, 1618, 1615, 1644, 1662, 1617, 1645, 1618, 1611, 1618, 1607, 1613, 1617, 1619, 1612, 1609, 1623, 1624, 1646, 1607, 1597, 1640, 1667, 1648, 1647, 1630, 1644, 1606, 1606, 1620, 1624, 1616, 1597, 1646, 1615, 1661, 1650, 1647, 1640, 1602, 1603, 1595, 1586, 1644, 1621, 1630, 1616, 1584, 1632, 1624, 1608, 1662, 1641, 1656, 1645, 1593, 1593, 1567, 1608, 1632, 1594, 1643, 1667, 1645, 1624, 1616, 1632, 1646, 1660, 1628, 1640, 1593, 1618, 1645, 1594, 1628, 1631, 1593, 1615, 1594, 1614, 1646, 1656, 1648, 1620, 1656, 1656, 1666, 1670, 1664, 1694, 1616, 1626, 1614, 1660, 1618, 1617, 1659, 1606, 1660, 1622, 1662, 1654, 1566, 1614, 1634, 1596, 1630, 1619, 1646, 1595, 1608, 1656, 1645, 1605, 1644, 1621, 1673, 1635, 1618, 1621, 1616, 1645, 1606, 1622, 1618, 1608, 1579, 1618, 1619, 1616, 1672, 1640, 1645, 1623, 1590, 1635, 1623, 1616, 1631, 1632, 1618, 1610, 1585, 1620, 1621, 1604, 1749, 1622, 1632, 1656, 1627, 1623, 1618, 1645, 1595, 1614, 1622, 1667, 1606, 1620, 1648, 1619, 1669, 1614, 1640, 1655, 1616, 1638, 1602, 1642, 1625, 1618, 1667, 1621, 1618, 1646, 1624, 1646], dtype=uint16), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64)], 'timing': [[], [], [10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], 'time': [array([], dtype=float64), array([], dtype=float64), array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428, 429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480, 481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 510, 511]), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64)], 'created_at': 0, 'pkg_num': 0, 'event_num': 0, 'name': None}
{'window_labels': [[], [], [32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], 'evt_window_labels': [[], [], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], 'data': [array([], dtype=float64), array([], dtype=float64), array([2053, 2108, 2102, 2078, 2073, 2092, 2099, 2090, 2058, 2074, 2076,
2095, 2094, 2078, 2028, 2069, 2106, 2088, 2072, 2025, 2009, 2082,
2078, 2067, 2068, 2058, 2028, 2054, 2024, 2075, 2074, 2080, 2056,
2046, 2071, 2076, 2054, 2044, 2078, 2085, 2002, 2032, 2040, 2035,
2033, 2046, 2050, 2025, 2033, 2078, 2071, 2040, 2005, 2026, 2044,
2040, 2003, 2040, 2046, 2032, 2055, 2076, 2054, 2025, 2040, 2069,
2082, 2088, 2048, 2046, 2052, 1984, 1664, 1573, 1573, 1620, 1572,
1558, 1529, 1518, 1534, 1541, 1538, 1480, 1491, 1516, 1520, 1477,
1529, 1519, 1459, 1488, 1486, 1500, 1517, 1516, 1590, 1516, 1566,
1554, 1518, 1517, 1528, 1516, 1455, 1446, 1486, 1466, 1488, 1468,
1467, 1452, 1486, 1467, 1510, 1526, 1463, 1492, 1487, 1451, 1491,
1506, 1468, 1491, 1496, 1516, 1493, 1481, 1487, 1493, 1492, 1490,
1470, 1469, 1484, 1502, 1495, 1488, 1457, 1504, 1520, 1489, 1516,
1492, 1535, 1568, 1509, 1503, 1488, 1536, 1540, 1516, 1490, 1517,
1502, 1515, 1501, 1540, 1544, 1539, 1547, 1522, 1524, 1541, 1566,
1540, 1538, 1542, 1524, 1542, 1536, 1568, 1506, 1518, 1554, 1528,
1548, 1536, 1559, 1550, 1510, 1542, 1505, 1510, 1517, 1526, 1555,
1568, 1556, 1552, 1506, 1536, 1537, 1558, 1576, 1540, 1483, 1497,
1503, 1542, 1525, 1515, 1531, 1528, 1491, 1526, 1540, 1523, 1542,
1568, 1554, 1530, 1522, 1550, 1550, 1527, 1516, 1524, 1498, 1518,
1534, 1525, 1532, 1541, 1570, 1528, 1549, 1561, 1542, 1544, 1559,
1569, 1510, 1527, 1542, 1568, 1557, 1528, 1542, 1556, 1565, 1563,
1584, 1602, 1507, 1566, 1550, 1518, 1550, 1546, 1547, 1567, 1560,
1593, 1564, 1574, 1614, 1618, 1644, 1616, 1607, 1638, 1634, 1598,
1616, 1599, 1616, 1619, 1594, 1605, 1612, 1596, 1628, 1619, 1608,
1640, 1592, 1626, 1645, 1579, 1606, 1643, 1606, 1617, 1592, 1619,
1635, 1619, 1624, 1544, 1658, 1673, 1646, 1669, 1650, 1640, 1593,
1612, 1630, 1637, 1644, 1606, 1628, 1620, 1646, 1629, 1635, 1646,
1641, 1644, 1657, 1598, 1622, 1622, 1620, 1620, 1608, 1640, 1629,
1619, 1614, 1619, 1670, 1632, 1596, 1598, 1626, 1610, 1638, 1604,
1644, 1622, 1625, 1622, 1618, 1615, 1644, 1662, 1617, 1645, 1618,
1611, 1618, 1607, 1613, 1617, 1619, 1612, 1609, 1623, 1624, 1646,
1607, 1597, 1640, 1667, 1648, 1647, 1630, 1644, 1606, 1606, 1620,
1624, 1616, 1597, 1646, 1615, 1661, 1650, 1647, 1640, 1602, 1603,
1595, 1586, 1644, 1621, 1630, 1616, 1584, 1632, 1624, 1608, 1662,
1641, 1656, 1645, 1593, 1593, 1567, 1608, 1632, 1594, 1643, 1667,
1645, 1624, 1616, 1632, 1646, 1660, 1628, 1640, 1593, 1618, 1645,
1594, 1628, 1631, 1593, 1615, 1594, 1614, 1646, 1656, 1648, 1620,
1656, 1656, 1666, 1670, 1664, 1694, 1616, 1626, 1614, 1660, 1618,
1617, 1659, 1606, 1660, 1622, 1662, 1654, 1566, 1614, 1634, 1596,
1630, 1619, 1646, 1595, 1608, 1656, 1645, 1605, 1644, 1621, 1673,
1635, 1618, 1621, 1616, 1645, 1606, 1622, 1618, 1608, 1579, 1618,
1619, 1616, 1672, 1640, 1645, 1623, 1590, 1635, 1623, 1616, 1631,
1632, 1618, 1610, 1585, 1620, 1621, 1604, 1749, 1622, 1632, 1656,
1627, 1623, 1618, 1645, 1595, 1614, 1622, 1667, 1606, 1620, 1648,
1619, 1669, 1614, 1640, 1655, 1616, 1638, 1602, 1642, 1625, 1618,
1667, 1621, 1618, 1646, 1624, 1646], dtype=uint16), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64)], 'timing': [[], [], [10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []], 'time': [array([], dtype=float64), array([], dtype=float64), array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,
130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,
143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,
169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,
195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,
234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,
247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,
260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,
273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285,
286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,
299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311,
312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337,
338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350,
351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,
364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376,
377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389,
390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402,
403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415,
416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428,
429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441,
442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454,
455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467,
468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480,
481, 482, 483, 484, 485, 486, 487, 488, 489, 490, 491, 492, 493,
494, 495, 496, 497, 498, 499, 500, 501, 502, 503, 504, 505, 506,
507, 508, 509, 510, 511]), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64), array([], dtype=float64)], 'created_at': 0, 'pkg_num': 0, 'event_num': 0, 'name': None}
It appears that the section
'timing': [[], [], [10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]
'timing': [[], [], [10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814, 10488814], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []]
has some of timestamps. I'm guessing they're the current clock cycle stored in some register. There's an array for each channel. I don't know why each channel has 16 copies of the timestamp; I checked that these 16 numbers are always equal to each other in any event.
I modified this notebook:
https://github.com/NaluScientific/naluexamples/blob/main/examples/opening_acquisitions.ipynb
To have this code loop through events and create a histogram of the differences between timestamps in
import matplotlib.pyplot as plt import numpy as np from naludaq.backend import DiskAcquisition # Path to the acquisition data ACQ_PATH = r"/home/pioneer/nalu_stuff/first_project/2024-12-18 21-08-39.934460" # Initialize a list to store timestamps for each channel channel_timestamps = [] max_timestamp_value = 16777216 # Assumed power of 2 (2^24) # DiskAcquisition is recommended to be used as a context manager for safety with DiskAcquisition(ACQ_PATH) as acq: print("Board model:", acq.params["model"]) print("Number of events:", len(acq)) print("Pedestals stored:", acq.pedestals is not None) # Loop through all events and collect the first timing entry from non-empty channels for EVENT_INDEX in range(len(acq)): EVENT = acq[EVENT_INDEX] if EVENT.get("data", None) is None: print(f"Event {EVENT_INDEX} is corrupted!") else: # Get the timing data for the event timing = EVENT.get("timing", []) # Iterate through each channel's timing data for channel_idx, channel_timing in enumerate(timing): if channel_timing: # Only consider non-empty timing data first_timestamp = channel_timing[0] # Check if all values in the timing array are the same if len(set(channel_timing)) > 1: print(f"Warning: Channel {channel_idx} has inconsistent timing values!") # Store the first timestamp for this channel channel_timestamps.append(first_timestamp) # Compute the differential time between successive events if len(channel_timestamps) > 1: diff_times = np.diff(channel_timestamps) # Computes the difference between successive timestamps # Filter out negative values from diff_times diff_times = diff_times[diff_times >= 0] #Printing np.set_printoptions(threshold=np.inf) print(channel_timestamps) print(diff_times) # Plotting the differential times as a histogram plt.hist(diff_times, bins=50, edgecolor='black') plt.xlabel("Time Difference") plt.ylabel("Frequency") plt.title("Time Between Events (~1 Hz external trigger)") plt.show() else: print("Not enough timestamps to calculate differentials!")
import matplotlib.pyplot as plt
import numpy as np
from naludaq.backend import DiskAcquisition
# Path to the acquisition data
ACQ_PATH = r"/home/pioneer/nalu_stuff/first_project/2024-12-18 21-08-39.934460"
# Initialize a list to store timestamps for each channel
channel_timestamps = []
max_timestamp_value = 16777216 # Assumed power of 2 (2^24)
# DiskAcquisition is recommended to be used as a context manager for safety
with DiskAcquisition(ACQ_PATH) as acq:
print("Board model:", acq.params["model"])
print("Number of events:", len(acq))
print("Pedestals stored:", acq.pedestals is not None)
# Loop through all events and collect the first timing entry from non-empty channels
for EVENT_INDEX in range(len(acq)):
EVENT = acq[EVENT_INDEX]
if EVENT.get("data", None) is None:
print(f"Event {EVENT_INDEX} is corrupted!")
else:
# Get the timing data for the event
timing = EVENT.get("timing", [])
# Iterate through each channel's timing data
for channel_idx, channel_timing in enumerate(timing):
if channel_timing: # Only consider non-empty timing data
first_timestamp = channel_timing[0]
# Check if all values in the timing array are the same
if len(set(channel_timing)) > 1:
print(f"Warning: Channel {channel_idx} has inconsistent timing values!")
# Store the first timestamp for this channel
channel_timestamps.append(first_timestamp)
# Compute the differential time between successive events
if len(channel_timestamps) > 1:
diff_times = np.diff(channel_timestamps) # Computes the difference between successive timestamps
# Filter out negative values from diff_times
diff_times = diff_times[diff_times >= 0]
#Printing
np.set_printoptions(threshold=np.inf)
print(channel_timestamps)
print(diff_times)
# Plotting the differential times as a histogram
plt.hist(diff_times, bins=50, edgecolor='black')
plt.xlabel("Time Difference")
plt.ylabel("Frequency")
plt.title("Time Between Events (~1 Hz external trigger)")
plt.show()
else:
print("Not enough timestamps to calculate differentials!")
There seems to be a maximum to the timing value (I'm guessing it's 2^24 -1), after this the values seem to loop back around. Subsequently, I just ignored negative values when plotting the diff histograms below.
[16543325, 16546825, 16550325, 16553825, 16557325, 16560826, 16564326, 16567826, 16571326, 16574826, 16578326, 16581826, 16585326, 16588826, 16592326, 16595827, 16599327, 16602827, 16606327, 16609827, 16613327, 16616827, 16620327, 16623827, 16627328, 16630827, 16634328, 16637828, 16641328, 16644827, 16648328, 16651828, 16655328, 16658828, 16662328, 16665828, 16669328, 16672828, 16676328, 16679828, 16683328, 16686829, 16690329, 16693829, 16697329, 16700829, 16704329, 16707829, 16711329, 16714829, 16718329, 16721830, 16725330, 16728830, 16732330, 16735830, 16739330, 16742830, 16746330, 16749830, 16753331, 16756831, 16760331, 16763831, 16767331, 16770831, 16774331, 615, 4115,
[16543325, 16546825, 16550325, 16553825, 16557325, 16560826, 16564326, 16567826, 16571326, 16574826, 16578326, 16581826, 16585326, 16588826, 16592326, 16595827, 16599327, 16602827, 16606327, 16609827, 16613327, 16616827, 16620327, 16623827, 16627328, 16630827, 16634328, 16637828, 16641328, 16644827, 16648328, 16651828, 16655328, 16658828, 16662328, 16665828, 16669328, 16672828, 16676328, 16679828, 16683328, 16686829, 16690329, 16693829, 16697329, 16700829, 16704329, 16707829, 16711329, 16714829, 16718329, 16721830, 16725330, 16728830, 16732330, 16735830, 16739330, 16742830, 16746330, 16749830, 16753331, 16756831, 16760331, 16763831, 16767331, 16770831, 16774331, 615, 4115,
Here are the plots:
I only took a few seconds of data for each rate; So each aquistion is somewhere between 3 and 10 seconds of data taking.
I'm not understanding the timing differences. They do appear to get smaller the higher the rate (though the ~1 Hz to ~100 Hz region all have about the same time differences). However, they don't scale correctly. I would expect the time difference between 1850Hz and 17855Hz to scale by about a factor of 10, but it's more like a factor of 5. Furthermore the jump from 17855Hz to 172700 Hz should scale by a factor of 10, but don't. Mayb there's some maximum rate the board can handle for external trigger which is bottlenecking things at higher rates.
I did some "fine control" on the gate generator to change the rate. I did a sort of "binary search" to maximize the data rate based on the trigger rate. We know the optimal event rate is around 2kHz, so my start is at about 1kHz.
The way I did this way I just left a midas run going while I adjusted the trigger rate with the "fine control", reading the trigger rate off the oscilliscope.
The "binary search" results confused me:
Window size 62, all channels enabled:
Gate Generator Knob Setting (Hz) | Oscilloscope Measured Rate (Hz) | MIDAS Data Rate (MB/s) | Screenshot Link |
---|---|---|---|
1 | <10 | 0.25 | Screenshot |
10 | 18 | 2.7 | Screenshot |
100 | 191 | 14.1 | Screenshot |
1000 | 1850 | 21 | Screenshot |
10000 | 17855 | 17.6 | Screenshot |
100000 | 172700 | 17.7 | Screenshot |
1000 | 1002 | 20.1 | Screenshot |
1000 | 2980 | 19.6 | Screenshot |
1000 | 2000 | 20.7 | Screenshot |
1000 | 1502 | 19.6 | Screenshot |
1000 | 1748 | 20.7 | Screenshot |
1000 | 1850 | 20.5 | Screenshot |
100 | 497 | 18.1 | Screenshot |
100 | 798 | 17.1 | Screenshot |
So I am taking a more systematic approach next.
I realized I never was really explicitly setting the channels for these tests, so I went and used the method:
if self.channels: get_readout_controller(self.board).set_readout_channels(self.channels)
if self.channels:
get_readout_controller(self.board).set_readout_channels(self.channels)
to set it and verified with:
print(get_readout_controller(self.board).get_readout_channels())
print(get_readout_controller(self.board).get_readout_channels())
If we specify no channels, the print statement prints all channels are enabled for readout (which makes sense given out data rates). I.e. all previous tests were with 32 channels, but I was already operating under that assumption.
I've "consolidated" my data into 3 tables with corresponding plots
Window size 32, all channels enabled:
Gate Generator Knob Setting (Hz) | Target Trigger Rate (Hz) | Oscilloscope Measured Rate (Hz) | MIDAS Data Rate (MB/s) | Screenshot Link |
---|---|---|---|---|
1 | - | <10 | 0.25 | Link |
10 | - | 18 | 2.7 | Link |
100 | 100 | 101 | 14.7 | Link |
100 | 250 | 249 | 14.2 | Link |
100 | 500 | 497 | 18.1 | Link |
100 | 750 | 798 | 17.1 | Link |
1000 | 1000 | 1002 | 20.1 | Link |
1000 | 1250 | 1246 | 20.2 | Link |
1000 | 1500 | 1502 | 19.6 | Link |
1000 | 1750 | 1748 | 20.7 | Link |
1000 | 2000 | 2000 | 20.7 | Link |
1000 | 2500 | 2501 | 18.8 | Link |
1000 | 2750 | 2745 | 19.9 | Link |
1000 | 3000 | 2980 | 19.6 | Link |
10000 | - | 17855 | 17.6 | Link |
100000 | - | 172700 | 17.7 | Link |
Window size 1, all channels enabled
Gate Generator Knob Setting (Hz) | Target Trigger Rate (Hz) | Oscilloscope Measured Rate (Hz) | MIDAS Data Rate (MB/s) | Screenshot Link |
---|---|---|---|---|
1 | 1 | 1 | 0.24 | Link |
100 | 100 | 101 | 0.24 | Link |
1000 | 1000 | 973 | 2.29 | Link |
10000 | 10000 | 9416 | 22.1 | Link |
10000 | 20000 | 20375 | 47.9 | Link |
10000 | 22500 | 22390 | 52.7 | Link |
10000 | 23750 | 23770 | 54.2 | Link |
10000 | 25000 | 25024 | 54.7 | Link |
10000 | 30000 | 30337 | 54.7 | Link |
100000 | 100000 | 92289 | 54.7 | Link |
Window size 1, 1 channel enabled:
Gate Generator Knob Setting (Hz) | Target Trigger Rate (Hz) | Oscilloscope Measured Rate (Hz) | MIDAS Data Rate (MB/s) | Screenshot Link |
---|---|---|---|---|
100 | 100 | 108 | 0.01 | Link |
1000 | 1000 | 1041 | 0.07 | Link |
10000 | 10000 | 10077 | 0.74 | Link |
100000 | 100000 | 98657 | 7.26 | Link |
100000 | 200000 | 200000 | 13.1 | Link |
100000 | 500000 | 499530 | 14.8 | Link |
100000 | 625000 | 623000 | 15.2 | Link |
100000 | 700000 | 689000 | 16.8 | Link |
100000 | 750000 | 752600 | 18.1 | Link |
100000 | 875000 | 872400 | 15.9 | Link |
1000000 | 1000000 | 891670 | 16.3 | Link |